<template>
  <GwContent class="dashboard">
    <GwTitle>UI FRAME</GwTitle>
    <UiSection label="ECharts" :show="false">
      <div ref="myChart" style="width: 300px; height: 300px;" />
    </UiSection>
  </GwContent>
</template>

<script>
import echarts from 'echarts'

export default {
  name: 'Dashboard',
  data() {
    return {
      time: '',
      routes: []
    }
  },
  mounted() {
    this.testCharts()
  },
  created() {
    // this.initRoutes()
  },
  methods: {
    // async initRoutes(cb) {
    //   const res = await routes.getList()
    //   this.$store.dispatch('permission/generateRoutes', res.data.success ? res.data.data : [])
    //   this.initRoutes(res.data.success ? res.data.data : [])
    // },

    testCharts() {
      echarts.init(this.$refs.myChart).setOption({
        title: { text: '在Vue中使用echarts' },
        tooltip: {},
        xAxis: {
          data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {},
        series: [{
          name: '销量',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20]
        }]
      })
    }
  }
}
</script>
